﻿using KingerRobot.MexicoSailunMES.Dao;

namespace KingerRobot.MexicoSailunMES.Spi.DTO;
public class ProductInfoBean
{

    /// <summary>
    /// GT 条码
    /// </summary>
    public string BCD_NO { get; set; }

    /// <summary>
    /// GT 物料编码
    /// </summary>
    public string TBM_SPEC { get; set; }

    /// <summary>
    /// GT 物料描述
    /// </summary>
    public string TBM_SPEC_DESC { get; set; }

    /// <summary>
    /// GT 生产版本
    /// </summary>
    public string TBM_SPEC_VER { get; set; }

    /// <summary>
    /// GT 有效期
    /// </summary>
    public DateTime? TBM_EXPIRATION_TIME { get; set; }

    /// <summary>
    /// 实验跟踪号
    /// </summary>
    public string TBM_PS { get; set; }

    /// <summary>
    /// 成型机号
    /// </summary>
    public string TBM_NO { get; set; }

    /// <summary>
    /// 生产日期
    /// </summary>
    public DateTime? PROD_DT { get; set; }

    /// <summary>
    /// 标准重量
    /// </summary>
    public decimal? STD_WT { get; set; }

    /// <summary>
    /// 重量下限
    /// </summary>
    public decimal? MIN_WT { get; set; }

    /// <summary>
    /// 重量上限
    /// </summary>
    public decimal? MAX_WT { get; set; }
    /// <summary>
    /// 实际重量
    /// </summary>
    public decimal? ACT_WT { get; set; }
    /// <summary>
    /// 错误编码
    /// </summary>
    public string ERR_CD { get; set; }
    /// <summary>
    /// 重量状态
    /// </summary>
    public string PROC_STAT { get; set; }
    /// <summary>
    /// 存储位置
    /// </summary>
    public string RACK_ADD { get; set; }
    /// <summary>
    /// 入库许可
    /// </summary>
    public string IN_PERMIT { get; set; }

    /// <summary>
    /// 创建日期
    /// </summary>
    public DateTime? REG_DT { get; set; }

    /// <summary>
    /// 硫化机台
    /// </summary>
    public string RELATEEQUIPMENT { get; set; }

    /// <summary>
    /// GT 高度
    /// </summary>
    public int? HEIGHT { get; set; }

    public static ProductInfoBean Create(POBcdInfo info)
    {

        return new ProductInfoBean
        {
            BCD_NO = info.BcdNo,
            TBM_SPEC = info.TbmSpec,
            TBM_SPEC_DESC = info.TbmSpecDesc,
            TBM_NO = info.TbmNo,
            HEIGHT = info.HEIGHT,
            IN_PERMIT = info.InPermit,
            MAX_WT = info.MaxWt,
            STD_WT = info.StdWt,
            MIN_WT = info.MinWt,
            PROD_DT = info.ProdDt,
            REG_DT = info.RegDt,
            RELATEEQUIPMENT = info.Relateequipment,
            TBM_EXPIRATION_TIME = info.TbmExpirationTime,
            TBM_PS = info.TbmPs,
            TBM_SPEC_VER = info.TbmSpecVer,
        };
    }
}
